package behaviour.observer_java;

/**
 * java中对观察者的支持
 * 被观察者继承Observable类
 * 观察者实现Observer接口
 *
 * @author yeyangtao created at 2020/7/7 14:51
 */
public class ObserverDemo {
    public static void main(String[] args) {
        Watched watched = new Watched();

        new Watcher(watched);

        watched.setState(1);
        watched.setState(2);
    }
}
